package com.sand.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "t_user", schema = "ssh_pro", catalog = "")
public class TUserEntity {
/**
 *
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/11/28/028 14:46
 */

    private int rid;
    private String loginName;
    private String password;
    private String userName;
    private int post;
    private String phone;
    private int status;
    private Timestamp createTime;
    private String remark;

    private String postView;

    public String getPostView() {
        return postView;
    }

    public void setPostView(String postView) {
        this.postView = postView;
    }

    @Id
    @GeneratedValue(generator = "t_user")
    @GenericGenerator(name = "t_user", strategy = "native")
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "loginName")
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "userName")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "post")
    public int getPost() {
        return post;
    }

    public void setPost(int post) {
        this.post = post;
    }

    @Basic
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "createTime")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TUserEntity that = (TUserEntity) o;
        return rid == that.rid && status == that.status && Objects.equals(loginName, that.loginName) && Objects.equals(password, that.password) && Objects.equals(userName, that.userName) && Objects.equals(post, that.post) && Objects.equals(phone, that.phone) && Objects.equals(createTime, that.createTime) && Objects.equals(remark, that.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, loginName, password, userName, post, phone, status, createTime, remark);
    }

    public TUserEntity(int rid, String loginName, String password, String userName, int post, String phone, int status, Timestamp createTime, String remark) {
        this.rid = rid;
        this.loginName = loginName;
        this.password = password;
        this.userName = userName;
        this.post = post;
        this.phone = phone;
        this.status = status;
        this.createTime = createTime;
        this.remark = remark;
    }

    public TUserEntity() {
    }

    @Override
    public String toString() {
        return "TUserEntity{" +
                "rid=" + rid +
                ", loginName='" + loginName + '\'' +
                ", password='" + password + '\'' +
                ", userName='" + userName + '\'' +
                ", post=" + post +
                ", phone='" + phone + '\'' +
                ", status=" + status +
                ", createTime=" + createTime +
                ", remark='" + remark + '\'' +
                ", postView='" + postView + '\'' +
                '}';
    }
}
